<%--
  Created by IntelliJ IDEA.
  User: qingx
  Date: 2018/12/10
  Time: 17:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- jsp文件头和头部 -->
    <%@ include file="../../base/top.jsp"%>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="hr hr-18 dotted hr-double"></div>
                <div class="row">
                    <div class="col-xs-12">

                        <div class="widget-header" style="text-align: center;height: 30px" >
                            <h3 class="widget-title" style="line-height: 20px"> ${courseDetail.courseInfo.courseName}</h3>
                        </div>

                        <div class="widget-main">
                            <div style="text-align: center">
                                <label >课程介绍：${courseDetail.courseInfo.courseDescription}</label>
                            </div>
                            <hr />

                            <div style="text-align: center; margin-top: -10px">
                                <label >开设学期：${courseDetail.courseInfo.courseStartTerm}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >学分：${courseDetail.courseInfo.courseCredit}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >学时：${courseDetail.courseInfo.courseHours}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >标签库：${courseDetail.labelLibInfo.labelLibName}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >阶段链：${courseDetail.stageChain}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >课程类别：${courseDetail.courseInfo.courseType}</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <label >考核方式：${courseDetail.courseInfo.courseAssessmentMethod}</label>
                            </div>
                            <hr style="margin-top: 5px"/>

                            <div align="right" style="margin-top: -10px">
                                <a>
                                    <div style="display: inline;">
                                        <span id="edit" class="glyphicon glyphicon-edit" aria-hidden="true" onclick="toModifyTeachcourse('${courseDetail.teachCourseId}')">修改课程</span>&nbsp;&nbsp;&nbsp;&nbsp;
                                    </div>
                                </a>

                                <div style="display: inline;">
                                    <a><span class="glyphicon glyphicon-user" aria-hidden="true" onclick="selectStudent('admin');">学生</span></a>
                                </div>
                            </div>

                            <hr style="height:1px;border:none;border-top:1px solid #555555;margin-top: 10px" />

                            <div class="page-content" style="margin-top: -10px" >
                                <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab" >
                                    <li class="active">
                                        <a data-toggle="tab" href="#task">任务</a>
                                    </li>
                                    <li>
                                        <a data-toggle="tab" href="#material">资料</a>
                                    </li>
                                    <li>
                                        <a data-toggle="tab" href="#group">分组</a>
                                    </li>
                                    <li>
                                        <a data-toggle="tab" href="#assignment">作业</a>
                                    </li>
                                </ul>

                                <div class="tab-content">
                                    <div id="task" class="tab-pane in active"></div>
                                    <div id="material" class="tab-pane"></div>
                                    <div id="group" class="tab-pane"></div>
                                    <div id="assignment" class="tab-pane"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
    <!-- 返回顶部 -->
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>

</div>
<!-- /.main-container -->
<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../../base/foot.jsp"%>

<script type="text/javascript">
    $(top.hangge());

    //准备tabs数据
    var tabsData = [{
        "id" : "task",
        "url" : "task_list"
    },{
        "id" : "material",
        "url" : "course_material"
    },{
        "id" : "group",
        "url" : "group"
    },
    {
        "id" : "assignment",
        "url" : "assignment_list"
    }];
    function showTabs(tabsId,url) {
        $("a[href='#"+tabsId+"']").tab('show');
        var tabContent = $('#'+tabsId);
        tabContent.load('teach_course/teach_course_detail_tab/${courseDetail.teachCourseId}/'+url);
    }
    function tabsHandler(event) {
        var data = event.data;
        showTabs(data.id,data.url);
        return false;
    }
    $(tabsData).each(function(){
        $("a[href='#"+this.id+"']").bind('click',{
            id : this.id,
            url : this.url
        },tabsHandler);
    });
    $("a[href='#task']").trigger("click");


    function toModifyTeachcourse(teachCourseId){
        window.location.href = "teach_course/toModifyTeachCourse?teachCourseId="+teachCourseId;
    }

</script>
</body>
</html>
